﻿namespace SuperMarieApi.App.Controllers.Framework.Common
{
    using System.Text.RegularExpressions;

    public static class StringExtensions
    {
        private static readonly Regex NameExpression = new Regex("([A-Z]+(?=$|[A-Z][a-z])|[A-Z]?[a-z]+)", RegexOptions.Compiled);

        public static bool EqualsTo(this string str, string to)
        {
            return str.EqualsTo(to, false);
        }

        public static bool EqualsTo(this string str, string to, bool ignoreCase)
        {
            return (string.Compare(str, to, ignoreCase) == 0);
        }

        public static string FormatWith(this string instance, params object[] args)
        {
            return string.Format(instance, args);
        }

        public static bool HasValue(this string value)
        {
            return !StringHelper.IsNullOrEmpty(value);
        }

        public static bool IsNullOrEmpty(this string instance)
        {
            return StringHelper.IsNullOrEmpty(instance);
        }
    }
}
